package org.westos.ChinaSoft3;

import java.io.*;
import java.util.Scanner;

public class Insert {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入ID");
        int i = sc.nextInt();
        Scanner sc1 = new Scanner(System.in);
        System.out.println("请输入Name");
        String s = sc1.nextLine();

        Scanner sc2 = new Scanner(System.in);
        System.out.println("请输入Age");
        int i1 = sc2.nextInt();

        Scanner sc3 = new Scanner(System.in);
        System.out.println("请输入Sex");
        String s1 = sc3.nextLine();

        Scanner sc4 = new Scanner(System.in);
        System.out.println("请输入SA");
        int i2 = sc4.nextInt();

        BufferedWriter bw =null;
        String str = null;
        str = i + "," + s + "," + i1 + "," + s1 + "," + i2;
        try {
            File file = new File("1.txt");
            bw = new BufferedWriter(new FileWriter(file,true));
            bw.write(str);
            bw.newLine();
            bw.flush();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            bw.close();
        }



    }
}